using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Entities;

public class SpawnCubesConfigAuthoring : MonoBehaviour
{
    public GameObject CubePrefab;
    public int SpawnCount;
    
    public class  Baker:Baker<SpawnCubesConfigAuthoring>
    {
        public override void Bake(SpawnCubesConfigAuthoring authoring)
        {
            Entity entity = GetEntity(TransformUsageFlags.None);
            
            AddComponent(entity,new SpawnCubesConfig
            {
                CubePrefabEntity = GetEntity(authoring.CubePrefab,TransformUsageFlags.Dynamic),
                SpawnCount = authoring.SpawnCount,
            } );
        }
    }
}

public struct SpawnCubesConfig : IComponentData
{
    public Entity CubePrefabEntity;
    public int SpawnCount;
}
